<template>
  <uni-nav-bar title="车友团详情" left-icon="left" @clickLeft="navBack" :fixed="true" statusBar></uni-nav-bar>
  <view class="package">
    <view class="space-between">
      <view>车友团名称</view>
      <view>{{TeamInfo.teamAll.name}}</view>
    </view>
    <view class="space-between top">
      <view>类型</view>
      <view>{{TeamInfo.teamAll.type_text}}</view>
    </view>
  </view>
  <view class="package space-between ability" style="background: transparent;padding: 0px;">
    <view v-for="(item,index) in list" :key="item" @click="navTo(item.push)"
      :style="{display:TeamInfo.teamAll.type==1&&index==4?'none':'block'}">{{item.name}}</view>
    <view @click="navTo('administrator/teamList/fenbo')" v-if="TeamInfo.teamAll.fenbo_id!=0">分拨账户</view>
  </view>
</template>

<script setup lang="ts">
  import { navBack, navTo } from '@/utils/navigator';
  import { ref } from 'vue';
  import { onLoad, onUnload } from '@dcloudio/uni-app';
  import { information } from '@/stores/administrator';
  const TeamInfo = information();
  const list = [{ name: '团成员', push: 'administrator/teamList/memberList' },
  { name: '价格', push: 'administrator/teamList/teamPrice' },
  { name: '团码', push: 'administrator/teamList/teamCode' },
  { name: '编辑', push: 'administrator/teamList/teamEdit' },
  { name: '团成员资格', push: 'administrator/teamList/teamCreden' }]
  const teamID = ref()
  onLoad((pearm) => {
    teamID.value = pearm.id
    TeamInfo.getDeliveryIn(teamID.value)
  })
  onUnload(() => {
    uni.removeStorageSync('team')
  })
</script>

<style scoped lang="less">
  .top {
    margin-top: 10rpx;
  }

  .ability {
    flex-wrap: wrap;

    view {
      width: 48.5%;
      height: 102rpx;
      background: #FFFFFF;
      border: 1px solid #EEF3F7;
      border-radius: 6px;
      text-align: center;
      line-height: 102rpx;
      margin-bottom: 15rpx;
    }
  }
</style>